package com.winiex.qqweibospider;

import com.tencent.weibo.api.Statuses_API;
import com.tencent.weibo.beans.OAuth;

public class WeiboAccesser {
	
	private OAuth oauth;
	
	public WeiboAccesser() {
		oauth = new OAuth();
		oauth.setOauth_consumer_key(Keys.consumerKey);
		oauth.setOauth_consumer_secret(Keys.consumerSecret);
		oauth.setOauth_token(Keys.accessKey);
		oauth.setOauth_token_secret(Keys.accessSecret);
	}
	
	public String getWeiboJSON() {
		String weibo = null;
		
		Statuses_API s_API = new Statuses_API();
		
		try {
			weibo = s_API.public_timeline(oauth, "json", "0", "100");
			System.out.println(weibo);
		} catch (Exception e) {
		}
		
		return weibo;
	}
	
}
